<?php
namespace Ibw\JobeetBundle\DataFixtures\ORM;
 
use Doctrine\Common\Persistence\ObjectManager;
use Doctrine\Common\DataFixtures\AbstractFixture;
use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
use Ibw\JobeetBundle\Entity\Category;
 
class LoadCategoryData extends AbstractFixture implements OrderedFixtureInterface
{
    public function load(ObjectManager $em)
    {
        $design = new Category();
        $design->setName('Design');
         $design->setSlugValue(); // @TODO ELETE THIS LINE AND USE LIFECYCLE CALLBACK PREPERSIST TO SET SLUGVALUE

        $programming = new Category();
        $programming->setName('Programming');
        $programming->setSlugValue(); // @TODO ELETE THIS LINE AND USE LIFECYCLE CALLBACK PREPERSIST TO SET SLUGVALUE
 
        $manager = new Category();
        $manager->setName('Manager');
         $manager->setSlugValue(); // @TODO ELETE THIS LINE AND USE LIFECYCLE CALLBACK PREPERSIST TO SET SLUGVALUE

        $administrator = new Category();
        $administrator->setName('Administrator');
         $administrator->setSlugValue(); // @TODO ELETE THIS LINE AND USE LIFECYCLE CALLBACK PREPERSIST TO SET SLUGVALUE

        $em->persist($design);
        $em->persist($programming);
        $em->persist($manager);
        $em->persist($administrator);
        $em->flush();
 
        $this->addReference('category-design', $design);
        $this->addReference('category-programming', $programming);
        $this->addReference('category-manager', $manager);
        $this->addReference('category-administrator', $administrator);
    }
 
    public function getOrder()
    {
        return 1; // the order in which fixtures will be loaded
    }
}